package com.example.news;

import com.example.news.slice.WelcomeAbilitySlice;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.aafwk.content.Operation;

import java.util.Timer;
import java.util.TimerTask;

public class WelcomeAbility extends Ability {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_welcome);
        Timer timer = new Timer();
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                Operation operation=new Intent.OperationBuilder()
                        .withDeviceId("")
                        .withBundleName("com.example.news.hmservice")
                        .withAbilityName("com.example.news.MainAbility")
                        .build();
                Intent intent = new Intent();
                intent.setOperation(operation);
                startAbility(intent);
            }
        };
        timer.schedule(task,3000);
    }



}
